<template>
  <div class="w-full h-full flex-col cflex text-[#303133]">
    <div class="font-bold mb-10 ml-32">视频导入</div>
    <div>
      <a-form
        class="w-[600px]"
        :model="formState"
        name="basic"
        :label-col="{ span: 8 }"
        :wrapper-col="{ span: 16 }"
        autocomplete="off"
        @finish="onFinish"
        @finishFailed="onFinishFailed"
      >
        <a-form-item
          label="相机IP范围"
          name="ip_range"
          :rules="[{ required: true, message: '请输入相机IP范围!' }]"
        >
          <a-input v-model:value="formState.ip_range" />
        </a-form-item>
        <a-form-item
          label="相机用户名"
          name="username"
          :rules="[{ required: true, message: '请输入相机用户名!' }]"
        >
          <a-input v-model:value="formState.username" />
        </a-form-item>

        <a-form-item
          label="相机密码"
          name="password"
          :rules="[{ required: true, message: '请输入相机密码!' }]"
        >
          <a-input-password v-model:value="formState.password" />
        </a-form-item>

        <a-form-item :wrapper-col="{ offset: 8, span: 16 }" >
          <a-button type="primary" html-type="submit" block class="!mt-6">确认</a-button>
        </a-form-item>
      </a-form>
    </div>
  </div>
</template>

<script setup lang="ts">
import { reactive } from 'vue'

interface FormState {
  ip_range: string
  username: string
  password: string
}

const formState = reactive<FormState>({
  ip_range: '',
  username: '',
  password: ''
})
const onFinish = (values: any) => {
  console.log('Success:', values)
}

const onFinishFailed = (errorInfo: any) => {
  console.log('Failed:', errorInfo)
}
</script>

<style scoped></style>
